<%-- 
    Document   : chercheSejour2
    Created on : 27 juil. 2008, 01:29:54
    Author     : noel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Recherche Hotel</title>
    </head>
    <body>
      <fieldset><legend>Selectionner une ville puis un hotel</legend>
        <f:view>
         <h:form>
             <h:messages id="erreur" layout="list" errorClass="error" infoClass="confirm"/>
             <table><tr><td>Ville : </td><td><h:selectOneMenu value="#{SessionBean.selectedVille}" converter="VilleConverter">
                 <f:selectItems value="#{SessionBean.listeVille}"/>
             </h:selectOneMenu></td></tr>
             
        <h:panelGroup rendered="#{SessionBean.selectedVille != null}">                        
            <tr><td>Hotel : </td><td><h:selectOneMenu value="#{SessionBean.selectedHotel}" converter="HotelConverter">
                 <f:selectItems value="#{SessionBean.listeHotel}"/>
             </h:selectOneMenu></td></tr>
         </h:panelGroup><tr><td height="5"></td></tr>
     <tr><td><br><h:commandButton  value="Valider"/></td></tr></table>
       </fieldset>
         
         
         <h:panelGroup rendered="#{SessionBean.listePeriode != null}">
             <fieldset><legend>Les periodes tarifaires de l'hotel</legend>
             <h:dataTable value="#{SessionBean.listePeriode}" var="c">
                 <h:column>
                     <f:facet name="header">
                            <f:verbatim>Début période</f:verbatim>
                        </f:facet>
                        <h:outputText value="#{c.dateDebut}"><f:convertDateTime pattern="dd/MM/yyyy" /></h:outputText>
                    </h:column>
                    <h:column>
                     <f:facet name="header">
                            <f:verbatim>Fin période</f:verbatim>
                        </f:facet>
                        <h:outputText value="#{c.dateFin}"><f:convertDateTime pattern="dd/MM/yyyy" /></h:outputText>
                    </h:column>
                  <h:column>
                        <f:facet name="header">
                            <f:verbatim>Chambre Simple</f:verbatim>
                        </f:facet>
                        <h:outputText value="#{c.prixSimple}€"></h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <f:verbatim>Chambre Double</f:verbatim>
                        </f:facet>
                        <h:outputText value="#{c.prixDouble}€"></h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <f:verbatim>Suite</f:verbatim>
                        </f:facet>
                        <h:outputText value="#{c.prixSuite}€"></h:outputText>
                    </h:column>
                      <h:column>
                        <f:facet name="header">
                            <f:verbatim>Reserver</f:verbatim>
                        </f:facet>
                        <h:commandButton value="Reserver" action="#{SessionBean.clicReserv}"/>
                    </h:column>
             </h:dataTable>
          </fieldset>
         </h:panelGroup>
         </h:form>
        </f:view>
    </body>
</html>
